#include"ProcessBar.h"
const char*label="|/-\\";
    char bar[102];
void process_bar(int rate)
{
int label_length=strlen(label);
    if(rate<=100&&rate>=0)
        {
            printf("[%-100s][%d%%]%c\r",bar,rate,label[rate%label_length]);
            bar[rate++]=BODY;
            if(rate<100)
            bar[rate]=HEAD;
            else if(rate==101) 
                memset(bar,'\0',sizeof(bar));
            fflush(stdout);
}
}

